<template>
    <div class="pbox">
        <h3>父组件</h3>
        <div>来自儿子的信息:<span class="cc">{{info}}</span></div>
       <child @make="getMsgFromChild"></child>
    </div>
</template>

<script>
import Child from '@/components/Child.vue'
export default {
  components: { Child },
  data(){
    return{
      info:''
    }
  },
  methods:{
    //此处用于接收子函数的参数是$emit的第2个参数
    getMsgFromChild(val){
       this.info=val
    }
  }
}
</script>

<style>
  .pbox{
    width: 500px;
    padding: 10px;
    background-color:tomato;
  }
  .cc{
    color:#fff;
  }
</style>